home *** CD-ROM | disk | FTP | other *** search
/ Aminet 21 / Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso / Aminet / comm / mail / AEMail.lha / aemail130 / Install_AEMail < prev    next >
Text File  |  1997-08-31  |  38KB  |  999 lines

  1. ;**
  2. ;** Install_AEMail - AEMail installation script for Installer
  3. ;**
  4. ;** Copyright (c) 1996, 1997 John F. Zacharias
  5. ;**                    All rights reserved.
  6. ;**
  7. ;** This script has been tested with Installer 43.3 which is included with
  8. ;** this archive:
  9. ;**
  10. ;**     Installer and Installer project icon
  11. ;**     (c) Copyright 1995-96 Escom AG.  All Rights Reserved.
  12. ;**     Reproduced and distributed under license from Escom AG.
  13. ;**
  14. ;**     INSTALLER SOFTWARE IS PROVIDED "AS-IS" AND SUBJECT TO CHANGE;
  15. ;**     NO WARRANTIES ARE MADE.  ALL USE IS AT YOUR OWN RISK.  NO LIABILITY
  16. ;**     OR RESPONSIBILITY IS ASSUMED.
  17. ;**
  18. ;** Use following Icon tooltypes / Command line options:
  19. ;**
  20. ;** APPNAME=AEMail
  21. ;** MINUSER=NOVICE
  22. ;**
  23. ;**
  24. ;** Installer script modified on 09/01/97 for AEMail Version 1.30
  25.  
  26. (set
  27.  ;;
  28.  ;; The source directory name
  29.  ;;
  30.  source-dir (if (= 1 (exists @icon))
  31.             (pathonly (expandpath @icon))
  32.             (expandpath @icon)))
  33.  
  34. (set version_3_0 39)  
  35.  
  36. (set aem-vernum (getversion (tackon source-dir "AEMail")))
  37. (set
  38.     aem-vernew (/ aem-vernum 65536)
  39.     aem-revnew (- aem-vernum (* aem-vernew 65536)))
  40.  
  41. (set exec-version (/ (getversion) 65536))
  42. (set avail-mem (+ (database "total-mem")))
  43. (set system-cpu (database "cpu"))
  44.  
  45. (set full-aem-name "AEMail Beta Version 1.30")
  46.  
  47. (set
  48.     aem-name "AEMail"
  49.     aem-assign (cat aem-name ":")
  50.     aem-Termite 0
  51.     )
  52.  
  53. (if (< exec-version version_3_0)
  54.     (tooltype
  55.         (dest (tackon source-dir "AEMail.guide"))
  56.         (setdefaulttool "AmigaGuide"))
  57.     (tooltype
  58.         (dest (tackon source-dir "AEMail.guide"))
  59.         (setdefaulttool "MultiView")))
  60.  
  61. (if (= 1 (exists "ENV:TermiteTCP.prefs" (noreq)))
  62.          (set aem-Termite 1)
  63.          (set aem-Termite 0))
  64.  
  65. (if (= 2 (exists "AMITCP:bin" (noreq)))
  66.     (set aem-have-AMITCP 1)
  67.     (set aem-have-AMITCP 0))
  68.  
  69. (if (= 2 (exists "Miami:" (noreq)))
  70.     (set aem-have-MIAMI 1)
  71.     (set aem-have-MIAMI 0))
  72.  
  73. (if (= 1 (exists "ENV:AEMail_Dir" (noreq)))
  74.     (set @default-dest (getenv ("AEMail_Dir")))
  75.     (set @default-dest
  76.         (if (= 1 aem-have-AMITCP)
  77.             (expandpath "AMITCP:bin")
  78.             (@default-dest))))
  79.  
  80. (if (= "AEMail" (fileonly @default-dest))
  81.     (set @default-dest (pathonly @default-dest)))
  82.  
  83.  
  84. (if (= 2 @user-level)
  85.  
  86.     (set
  87.     ;;
  88.     ;; Sets up where to place AEMAIL program
  89.     ;;
  90.     @default-dest
  91.         (askdir
  92.             (prompt "Enter the drawer in which you want AEMail installed\n"
  93.                     "If not AMITCP:bin, a drawer called AEMail will be created "
  94.                     "if it does not already exist")
  95.             (help   "If you are using AmiTCP, AEMail should be installed in "
  96.                     "'AmiTCP:bin'\n\n"
  97.                     "However, you may install it anywhere you like\n\n"
  98.                     "If it is not 'AmiTCP:bin' a drawer called 'AEMail' "
  99.                     "will be created.\n")
  100.             (default @default-dest)
  101.             (newpath))))
  102.  
  103. (if (= 1 aem-have-AMITCP)
  104.     (if (<> @default-dest (expandpath "AMITCP:bin"))
  105.         (set aem-have-AMITCP 0)))
  106.  
  107. (if (= "AEMail" (fileonly @default-dest))
  108.     (set @default-dest (pathonly @default-dest)))
  109.  
  110. (if (= 0 aem-have-AMITCP)
  111.     (set @default-dest (tackon @default-dest "AEMail")))
  112.  
  113. (if (= 0 (exists @default-dest (noreq)))
  114.     ((makedir @default-dest (infos))
  115.      (onerror (delete @default-dest
  116.                 (prompt "Deleting AEMail directory")
  117.                 (help "Deleting AEMail directory")
  118.                 (infos)))))
  119.  
  120. (if (= 1 (exists @default-dest (noreq)))
  121.     (set @default-dest (pathonly @default-dest)))
  122.  
  123. (set aem-default-dest @default-dest)
  124.  
  125. (set
  126.  ;;
  127.  ;; The default Mail directory
  128.  ;;
  129.     aem-change-name 0
  130.  
  131.     atcp-dir (if (= 1 aem-have-AMITCP)
  132.         (expandpath "AMITCP:")
  133.         (@default-dest))
  134.  
  135.     aem-dft-maildir (if (= 2 (exists aem-assign (noreq)))
  136.         (pathonly(getassign aem-name))
  137.         (atcp-dir))
  138.  
  139.     aem-mail-name (if (= 2 (exists aem-assign (noreq)))
  140.         (fileonly(getassign aem-name))
  141.         (""))
  142.   )
  143.  
  144.  
  145. (if (<> "" aem-mail-name)
  146.     (if (<> "AEMail_Mail" aem-mail-name)
  147.         ((set
  148.             aem-change-name
  149.                 (askbool
  150.                     (prompt "Your AEMAIL: assignment is for:\n\n"
  151.                             (getassign aem-name) "\n\n"
  152.                             "This directory is not named \"AEMail_Mail\"\n\n"
  153.                             "Do you want to change the directory's name to "
  154.                             "\"AEMail_Mail\" and use it as your AEMAIL: directory?")
  155.                     (help   "This install script automatically uses an AEMAIL: "
  156.                             "assignment name of \"AEMail_Mail\".  If you reply NO "
  157.                             "to this request your existing AEMAIL: directory "
  158.                             "will NOT be used as your mail directory\n")
  159.                     (default 1))))))
  160.  
  161. (if (= 1 aem-change-name)
  162.  
  163.     ((rename (tackon aem-dft-maildir aem-mail-name)
  164.             (tackon aem-dft-maildir "AEMail_Mail")
  165.             (prompt "Relabeling AEMAIL: directory")
  166.             (help   "Relabeling AEMAIL: directory"))
  167.     (rename (tackon aem-dft-maildir ("%s.info" aem-mail-name))
  168.             (tackon aem-dft-maildir "AEMail_Mail.info")
  169.             (prompt "Relabeling AEMAIL: directory .info")
  170.             (help   "Relabeling AEMAIL: directory .info")))
  171. )
  172.  
  173. (set
  174.     aem-mail-dir (aem-dft-maildir))
  175.  
  176. (if (= 2 @user-level)
  177.  
  178.     (set
  179.         aem-mail-dir
  180.             (askdir
  181.                 (prompt "Enter the drawer in which you want your mail placed.  "
  182.                     "A drawer called 'AEMail_Mail' will be created in this "
  183.                     "drawer (if it does not already exist) and AEMAIL: will be "
  184.                     "assigned to 'AEMail_Mail'")
  185.                 (help   "All of your mail and configuration files will be stored "
  186.                     "in the 'AEMail_Mail' sub-directory of this drawer.  An assign "
  187.                     "statement will be assigned to the 'AEMail_Mail' sub-directory to 'AEMAIL:' "
  188.                     "and will be placed in your 'S:User-Startup' script.\n\n"
  189.                     "The directory your specify here will be created if it does "
  190.                     "not exist\b")
  191.                 (default aem-dft-maildir)
  192.                 (newpath))))
  193.  
  194. (set aem-mail-dir (tackon aem-mail-dir "AEMail_Mail"))
  195.  
  196. ; Use ENV:PAGER program, Multiview, or copy "More" to RAM: for use
  197.  
  198. (set
  199.  pager-cmd (if (exists "ENV:PAGER" (noreq)) (getenv "PAGER"))
  200.  pager-cmd
  201.     (if pager-cmd pager-cmd
  202.         (if (= 1 (exists "SYS:Utilities/Multiview" (noreq)))
  203.             ("SYS:Utilities/Multiview")
  204.             ((copyfiles
  205.                 (prompt "Copying " (tackon source-dir "c/More") " to RAM: for use")
  206.                 (source (tackon source-dir "c/More"))
  207.                 (dest   "RAM:")
  208.                 (safe)
  209.                 (optional "nofail"))
  210.                 "RAM:More"))))
  211.  
  212. (copyfiles
  213.     (prompt "Copying AEMAIL.readme to RAM:")
  214.     (source (tackon source-dir "AEMail.readme"))
  215.     (dest   "RAM:"))
  216.  
  217. (set
  218.     aem-configure 0
  219.     aem-interlace 0
  220.     aem-needconfig 0
  221.     aem-options 3
  222.     aem-config ""
  223.     aem-username ""
  224.     aem-password ""
  225.     aem-from ""
  226.     aem-replyto ""
  227.     aem-organization ""
  228.     aem-realname ""
  229.     aem-domain ""
  230.     aem-popserver ""
  231.     aem-smtpserver ""
  232.     aem-editor ""
  233.     aem-startnet ""
  234.     aem-stopnet ""
  235.     aem-need-AREXX 0
  236.     aem-needstrtarexx 0
  237.     aem-needstoparexx 0)
  238.  
  239. (if (= 1 aem-have-MIAMI)
  240.     (set
  241.         aem-need-AREXX 1
  242.         aem-needstrtarexx 1
  243.         aem-startnet (tackon aem-default-dest "startnet.miami")
  244.         aem-needstoparexx 1
  245.         aem-stopnet  (tackon aem-default-dest "stopnet.miami"))
  246.     (if (= 1 aem-have-AMITCP)
  247.         (set
  248.             aem-need-AREXX 1
  249.             aem-startnet (tackon aem-default-dest "startnet")
  250.             aem-stopnet (tackon aem-default-dest "stopnet"))))
  251.  
  252. (if (= 1 aem-Termite)
  253.     ((set
  254.         aem-from (getenv "ttcp-email-address")
  255.         aem-tccp-len (strlen aem-from)
  256.         aem-tccp-cnt 0)
  257.  
  258.      (while (<> aem-tccp-cnt aem-tccp-len)
  259.             (if (= "@" (substr aem-from aem-tccp-cnt 1))
  260.                 (set
  261.                     aem-username
  262.                         (substr aem-from 0 aem-tccp-cnt)
  263.                     aem-tccp-cnt (+ 1 aem-tccp-cnt)
  264.                     aem-domain
  265.                         (substr aem-from aem-tccp-cnt))
  266.                 (set
  267.                     aem-tccp-cnt (+ 1 aem-tccp-cnt))))))
  268.  
  269.  
  270. (if (< 0 @user-level)
  271. (if (<> 1 (exists "s:aemail.cnfg" (noreq)))
  272. (set
  273.     aem-configure
  274.         (askbool
  275.             (prompt "\nYou can configure AEMail now or you can wait until "
  276.                     "AEMAIL is first loaded.  Do you want to configure now?\n")
  277.             (help   "AEMAIL is configured either by Tool Types in it's icon "
  278.                     "or by a configuration screen which is automatically "
  279.                     "called up when you first execute AEMAIL if the Tool "
  280.                     "Type parameters were not given.  By replying "
  281.                     "'Yes, Configure Now' you will be setting the Tool Type "
  282.                     "parameters\n")
  283.             (choices "Yes, Configure Now" "No, Configure Later"))
  284.     )
  285. (set
  286.     aem-configure
  287.         (askbool
  288.             (prompt "\nYou have an existing configuration file.\n\n"
  289.                     "Do you want to use it or do you want to re-configure "
  290.                     "AEMail now?\n")
  291.             (help   "By replying 'Yes, Re-configure Now' "
  292.                     "you will be renaming the current configuration file "
  293.                     "to 's:aemail.cnfg.old' "
  294.                     "and resetting the configuration by tool type "
  295.                     "parameters\n")
  296.             (choices "Yes, Re-Configure Now" "Use existing Config File")))
  297. )
  298. )
  299.  
  300. (if (= 1 aem-configure)
  301.     ((rename "s:aemail.cnfg" "s:aemail.cnfg.old"
  302.             (prompt "Renaming old s:aemail.cnfg file"))
  303.     (set aem-interlace
  304.         (askbool
  305.             (prompt "\n\nDo you want to open AEMAIL on an interlaced screen?")
  306.             (help   "Replying 'YES' will place the Tool Type 'INTERLACE=YES' "
  307.                     "in your AEMAIL icon.  This will open AEMAIL on an "
  308.                     "interlaced screen when it is executed.\n")))
  309.  
  310.     (Set continue 0)
  311.  
  312.     (message "\n\nWe need to know something about your Internet provider and what "
  313.         "the POP and SMTP Servers on your provider's machine are called.  "
  314.         "Also, when you signed up for your InterNet service you chose or "
  315.         "were given a login name and password for your POP server. "
  316.         "You will be prompted for these names now.  If you have any "
  317.         "questions as to what parameters to use, select 'help' "
  318.         "or consult information provided by your Internet provider.")
  319.  
  320.     (while
  321.         (= continue 0)
  322.  
  323.         (set
  324.  
  325.         aem-domain
  326.             (askstring
  327.                 (prompt "\nEnter the domain name for your InterNet Provider " 
  328.                         "required for getting mail\n\n")
  329.                 (help   "The domain name is usually the part of your e-mail address "
  330.                         "that follows the '@' sign.  If something else is required "
  331.                         "by your Internet Provider, provide it here.\n\n"
  332.                         "As an example, my email "
  333.                         "address is\n\njzachar@calweb.com\n\nThe domain name "
  334.                         "for my Internet provider is therefor 'calweb.com'.")
  335.                 (default aem-domain))
  336.  
  337.         aem-popserver
  338.             (if (= "" aem-domain)
  339.                 ("")
  340.                 (if (= "" aem-popserver)
  341.                     (cat "pop." aem-domain)
  342.                     (aem-popserver)))
  343.  
  344.         aem-smtpserver
  345.             (if (= "" aem-domain)
  346.                 ("")
  347.                 (if (= "" aem-smtpserver)
  348.                     (cat "smtp." aem-domain)
  349.                     (aem-smtpserver)))
  350.  
  351.         aem-popserver
  352.             (askstring
  353.                 (prompt "\nEnter the name of your POP Server\n\n")
  354.                 (help   "POP stands for 'Post Office Protocol' and your "
  355.                         "POP Server is the name assigned to the host "
  356.                         "computer that holds your Internet mail.  Normally "
  357.                         "this would be 'pop.' or 'mail.'  prepended to your "
  358.                         "Domain name.\n\n"
  359.                         "Consult your Internet provider if the POP Server "
  360.                         "is called something other than '"aem-popserver
  361.                         "' enter that name in this string requester ")
  362.                 (default aem-popserver))
  363.  
  364.         aem-smtpserver
  365.             (askstring
  366.                 (prompt "\nEnter the name of your SMTP Server\n")
  367.                 (help   "SMTP stands for 'Simple Mail Transfer Protocol' and "
  368.                         "your SMTP server is the name assigned to the host "
  369.                         "computer that sends your Internet mail.  Normally "
  370.                         "this would be 'smtp.' or 'mail.' prepended to your " 
  371.                         "Domain name.\n\n"
  372.                         "Consult your Internet provider if the SMTP Server "
  373.                         "is called something other than '"aem-smtpserver
  374.                         "' enter that name in this string requester ")
  375.                 (default aem-smtpserver))
  376.  
  377.         aem-username
  378.             (askstring
  379.                 (prompt "\nEnter the login name you have been assigned by your "
  380.                 "InterNet Provider for logging into your POP Server\n\n"
  381.                 "NOTE: Your provider may have allowed you to chose this login "
  382.                 "name.\n")
  383.                 (help "You must give your login name.  The login name consists "
  384.                 "of lowercase letters a-z and numbers.  Its recommended maximum "
  385.                 "length is 8 characters.\n\n"
  386.                 "Examples of acceptable login names are 'jzachar' and "
  387.                 "'an345'.")
  388.                 (default aem-username))
  389.  
  390.         aem-password
  391.             (askstring
  392.                 (prompt "\n\nEnter the password you need to log into your "
  393.                 "POP Server.\n\n"
  394.                 "NOTE: Your provider may have assigned you your password"
  395.                 " or you were allowed to chose your own.\n")
  396.                 (help   "This may be the same password that you use to log "
  397.                         "into your Internet Provider.  Consult your Internet "
  398.                         "Provider (ISP) if it is different.")
  399.                 (default aem-password))
  400.  
  401.  
  402.         continue
  403.             (askbool
  404.                 (prompt "Is the following information correct?\n\n"
  405.                     "SMTP Domain name: " aem-domain "\n"
  406.                     "POP Server Name: " aem-popserver "\n"
  407.                     "SMTP Server Name: " aem-smtpserver "\n"
  408.                     "Login name: " aem-username "\n"
  409.                     "Password: " aem-password "\n\n")
  410.                 (help "If you have made a mistake on any of the entries you "
  411.                 "can select \"No, Enter Again\" or, if eveything is all right, "
  412.                 "select \"Yes, Continue\"\n")
  413.                 (choices "Yes, Continue" "No, Enter Again"))
  414.         )
  415.     )
  416.  
  417.     (Set continue 0)
  418.  
  419.     (set
  420.         aem-from 
  421.             ("%s@%s" aem-username aem-domain))
  422.  
  423.     (message "\n\nWhen you signed up for your InterNet service you were "
  424.          "also assigned an email address to receive mail with.  You will "
  425.          "be prompted for this now.")
  426.  
  427.  
  428.     (while
  429.         (= continue 0)
  430.  
  431.         (set
  432.  
  433.         aem-from
  434.             (askstring
  435.                 (prompt "\n\nEnter your full email address (user@domain):\n")
  436.                 (help "You must give your email address.  The email address "
  437.                     "is what you are known by on the Internet and consists of " 
  438.                     "a username and domain name separated by an '@' sign.\n\n"
  439.                     "NOTE: The username and domain name could be the same "
  440.                     "as the POP login name and SMTP Domain Name you were "
  441.                     "prompted for before, or they MAY NOT be - consult your "
  442.                     "ISP.")
  443.                 (default aem-from))
  444.  
  445.         continue
  446.             (askbool
  447.                 (prompt "\n\nIs the following information correct?\n\n"
  448.                     "Email Address: " aem-from "\n\n")
  449.                 (help "If you have made a mistake with this entry you "
  450.                 "can select \"No, Enter Again\" or, if eveything is all right, "
  451.                 "select \"Yes, Continue\"\n")
  452.                 (choices "Yes, Continue" "No, Enter Again"))
  453.         )
  454.     )
  455.  
  456.     (Set continue 0)
  457.  
  458.     (message "\n\nThere is certain identity information that you will be "
  459.          "may give to further identify you on the Internet.  These include "
  460.          "your real name, a possible reply to address, and the organization "
  461.          "that you belong to.  You will be prompted for these now. These are "
  462.          "all optional parameters and you can leave them blank if you wish.")
  463.  
  464.     (set aem-replyto aem-from)
  465.  
  466.     (while
  467.         (= continue 0)
  468.  
  469.         (set
  470.  
  471.         aem-realname
  472.             (askstring
  473.                 (prompt "\n\nEnter the real name for "aem-from ":\n")
  474.                 (help "The real name can contain any characters except "
  475.                     "comma (','), colon (':') or bar ('|').")
  476.                 (default aem-realname))
  477.  
  478.         aem-replyto
  479.             (askstring
  480.                 (prompt "\n\nEnter the email address you want replies "
  481.                     "sent to\n\n")
  482.                 (help   "This may be the same as your regular email address. "
  483.                         "This address is optional and can be left blank.")
  484.                 (default aem-replyto))
  485.  
  486.         aem-organization
  487.             (askstring
  488.                 (prompt "\n\nEnter the organization you belong to (optional):\n")
  489.                 (help "The organization is optional and can be left blank.")
  490.                 (default aem-organization))
  491.  
  492.         continue
  493.             (askbool
  494.                 (prompt "\n\nIs the following information correct?\n\n"
  495.                     "Real name: " aem-realname "\n"
  496.                     "Reply To Address: " aem-replyto "\n"
  497.                     "Organization: " aem-organization "\n\n")
  498.                 (help "If you have made a mistake on any of the entries you "
  499.                 "can select \"No, Enter Again\" or, if eveything is all right, "
  500.                 "select \"Yes, Continue\"\n")
  501.                 (choices "Yes, Continue" "No, Enter Again"))
  502.         )
  503.     )
  504.  
  505.     (message "\n\nAEMail requires an editor to prepare messages to send.  "
  506.         "You can use the standard AmigaDOS editor, ed, or any "
  507.         "editor of your choice.")
  508.  
  509.  
  510.     (set
  511.         aem-editor
  512.             (askfile
  513.                 (prompt "Enter the Editor you want to use with AEMAIL.")
  514.                 (help   "AEMAIL requires an editor to prepare messages to "
  515.                         "send.  After your select the editor from the file "
  516.                         "requester you will be asked to enter parameter "
  517.                         "information required by your editor.\n")
  518.                 (default "SYS:c/ed"))
  519.  
  520.         aem-editor
  521.             (askstring
  522.                 (prompt "Add the parameters required for your editor.\n\n"
  523.                         "You must always add '%s' to specify where your "
  524.                         "mail file name goes.\n")
  525.                 (help   "You will need to add parmeters that may be "
  526.                         "required by your editor.  One required parameter "
  527.                         "required by ALL editors is '%s' to specify where "
  528.                         "the mail file name goes.\n")
  529.                 (default (cat aem-editor " %s")))
  530.  
  531.         aem-edonwb
  532.             (askbool
  533.                 (prompt "Does your editor have to open on the Workbench?"
  534.                 (help   "Some editors, like Commodores ED will always open "
  535.                         "on the Workbench.  Others will open on their own "
  536.                         "screen.  If your editor opens on the Workbench, "
  537.                         "you must reply 'YES' to this request.\n")))
  538.  
  539.         aem-editor
  540.             (if (= 1 aem-edonwb)
  541.                 (cat "WB;" aem-editor)
  542.                 ("%s" aem-editor))
  543.     )
  544.  
  545.     (set 
  546.         aem-neednetscrpts
  547.             (askbool
  548.                 (prompt "\n\nDo you want Start Net and/or Stop Net scripts?\n")
  549.                 (help   "If you reply 'Yes', you will be prompted for your "
  550.                         "Start Net and Stop Net scripts.\n"
  551.                         "If you reply 'No', AEMail will run without any "
  552.                         "Start Net or Stop Net scripts.\n")))
  553.  
  554.     (if (= 1 aem-neednetscrpts)
  555.         (if (<> "" aem-startnet)
  556.           (set aem-neednetscrpts
  557.             (askbool
  558.                 (prompt "Is your StartNet and/or StopNet scripts other than\n\n"
  559.                         "Start Net: " aem-startnet "\n"
  560.                         "Stop Net:  " aem-stopnet  "\n")
  561.                 (help   "Only reply 'YES' if your Start Net and Stop Net scripts "
  562.                         "are not the scripts listed listed below:\n\n"
  563.                          aem-startnet "\n"
  564.                          aem-stopnet "\n"))))
  565.         (set
  566.             aem-needstrtarexx 0
  567.             aem-startnet ""
  568.             aem-needstoparexx 0
  569.             aem-stopnet ""))
  570.  
  571.  
  572.     (if (= 1 aem-neednetscrpts)
  573.         ((set
  574.           need-startnet
  575.             (askbool
  576.                 (prompt "Do you need a Start Net script?")
  577.                 (help   "If you reply 'No' AEMail will run without a Start Net "
  578.                         "script\n\nIf you reply 'YES' you will be prompted "
  579.                         "for the location of your Start Net script")))
  580.         (if (= 1 need-startnet)
  581.              (set
  582.                aem-startnet
  583.                 (askfile
  584.                   (prompt "Enter the Start Net script you want to use with AEMAIL.")
  585.                   (help   "If you are not using the standard AmiTCP startnet "
  586.                           "script in AmiTCP:bin or the standard Miami script "
  587.                           "you will have to provide the "
  588.                           "script you are using.\n")
  589.                   (default (tackon aem-default-dest "startnet")))
  590.                aem-needstrtarexx
  591.                 (askbool
  592.                     (prompt "Is this an AmigaDOS script or an AREXX script?")
  593.                     (help   "The standard AmiTCP Start Net script is an AmigaDos "
  594.                             "script that calls AREXX\n\n "
  595.                             "The standard Miami script is an AREXX script "
  596.                             "AND must be called from AREXX\n")
  597.                     (choices "AREXX script" "AmigaDOS script")))
  598.              (set aem-startnet ""
  599.                   aem-needstrtarexx 0))
  600.  
  601.         (set
  602.           need-stopnet
  603.             (askbool
  604.                 (prompt "Do you need a Stop Net script?")
  605.                 (help   "If you reply 'No' AEMail will run without a Stop Net "
  606.                         "script\n\nIf you reply 'YES' you will be prompted "
  607.                         "for the location of your Stop Net script")))
  608.         (if (= 1 need-stopnet)
  609.             (set
  610.                aem-stopnet
  611.                 (askfile
  612.                   (prompt "Enter the Stop Net script you want to use with AEMAIL.")
  613.                   (help   "If you are not using the standard AmiTCP stopnet "
  614.                           "script in AmiTCP:bin or the standard Miami script "
  615.                           "you will have to provide the "
  616.                           "script you are using.\n")
  617.                   (default (tackon aem-default-dest "stopnet")))
  618.                aem-needstoparexx
  619.                 (askbool
  620.                     (prompt "Is this an AmigaDOS script or an AREXX script?")
  621.                     (help   "The standard AmiTCP Stop Net script is an AmigaDos "
  622.                             "script that calls AREXX\n\n "
  623.                             "The standard Miami script is an AREXX script "
  624.                             "AND must be called from AREXX\n")
  625.                     (choices "AREXX script" "AmigaDOS script")))
  626.              (set aem-stopnet ""
  627.                   aem-needstoparexx 0))))
  628.  
  629.     (set aem-options
  630.         (askoptions
  631.             (prompt "Select those AEMAIL options you want AEMAIL to open with\n\n")
  632.             (help @askoptions-help)
  633.             (choices "Delete Mail from Server"
  634.                  "Strip Duplicate Messages"
  635.                  "Display Full Header"
  636.                  "Include Header in Reply"
  637.                  "Automatic Connection at Startup"
  638.                  )
  639.             (default 3))
  640.     )))
  641.  
  642.  
  643. (if (= 1 aem-needstrtarexx)
  644.     (set
  645.         aem-startnet
  646.             (cat "rx " aem-startnet)))
  647.  
  648. (if (= 1 aem-needstoparexx)
  649.     (set
  650.         aem-stopnet
  651.             (cat "rx " aem-stopnet)))
  652.  
  653. (if (= 2 @user-level)
  654.     (set
  655.       aem-needconfig
  656.         (askbool
  657.             (prompt "Do you want to run with your own configuration file?")
  658.             (help   "If you are using the standard s:aemail.cnfg file "
  659.                     "reply 'NO'.\n\n"
  660.                     "If you want to use your own configuration file then "
  661.                     "reply 'YES'")))
  662.     (set aem-needconfig 0))
  663.  
  664. (if (= 1 aem-needconfig)
  665.     (set
  666.         aem-config
  667.             (askfile
  668.                 (prompt "Enter the configuration script you want to use "
  669.                         "with AEMail")
  670.                 (help   "If you are using a configuration file other than "
  671.                         "s:aemail.cnfg you can locate and or specify it "
  672.                         "here.")
  673.                 (default "s:aemail.cnfg"))))
  674.  
  675. (set
  676.     aem-docs-dir-dft (tackon @default-dest "documentation"))
  677.  
  678. (if (< 0 @user-level)
  679.     (set
  680.       aem-docs
  681.         (askoptions
  682.             (prompt "Select which AEMAIL documentation files you want copied\n\n")
  683.             (help @askoptions-help)
  684.             (choices "AEMAIL.readme"
  685.                      "AEMAIL.doc"
  686.                      "AEMAIL.guide"
  687.                      "email.txt"
  688.                      )
  689.             (default 15)))
  690.  
  691.     (set aem-docs 15))
  692.  
  693.  
  694. (if (= 2 @user-level)
  695.     (if (<> 0 aem-docs)
  696.         (set
  697.           aem-docs-dir
  698.             (askdir
  699.                 (prompt "Which directory do you want the documentation files "
  700.                         "copied to\n")
  701.                 (help   "You may select a different directory than your program "
  702.                         "directory to copy the documentation files to.\n")
  703.                 (newpath)
  704.                 (default aem-docs-dir-dft))))
  705.     (set aem-docs-dir aem-docs-dir-dft)
  706. )
  707.  
  708. (if (<> 2 (exists aem-mail-dir (noreq)))
  709.     (makedir aem-mail-dir (infos)))
  710.  
  711. (if (<> 2 (exists aem-docs-dir (noreq)))
  712.     (makedir aem-docs-dir (infos)))
  713.  
  714. (copyfiles
  715.     (prompt "Copying AEMail to " @default-dest)
  716.     (source (tackon source-dir "AEMail"))
  717.     (dest   @default-dest))
  718.  
  719. (copyfiles
  720.     (prompt "Copying AEMail.info to " @default-dest)
  721.     (source (tackon source-dir "AEMail.inf"))
  722.     (newname "AEMail.info")
  723.     (dest   @default-dest)
  724.     (noposition))
  725.  
  726. (copyfiles
  727.     (prompt "copy registration.form to " @default-dest)
  728.     (source (tackon source-dir "registration.form"))
  729.     (dest   @default-dest))
  730.  
  731. (if (= 1 aem-have-MIAMI)
  732.     ((copyfiles
  733.         (prompt "Copy Miami Start Net script to " @default-dest)
  734.         (source (tackon source-dir "startnet.miami"))
  735.         (dest   @default-dest))
  736.     (copyfiles
  737.         (prompt "Copy Miami Stop Net script to " @default-dest)
  738.         (source (tackon source-dir "stopnet.miami"))
  739.         (dest   @default-dest))))
  740.  
  741.  
  742. (if (<> 0 aem-docs)(
  743.     (if (BITAND aem-docs 1)
  744.         ((copyfiles
  745.             (prompt "Copying AEMAIL.readme file to " aem-docs-dir)
  746.             (source (tackon source-dir "AEMAIL.readme"))
  747.             (dest   aem-docs-dir)
  748.             (infos))
  749.         (tooltype
  750.             (dest (tackon aem-docs-dir "AEMAIL.readme"))
  751.             (setdefaulttool "more"))))       
  752.  
  753.     (if (BITAND aem-docs 2)
  754.         ((copyfiles
  755.             (prompt "Copying AEMAIL.doc file to " aem-docs-dir)
  756.             (source (tackon source-dir "AEMAIL.doc"))
  757.             (dest   aem-docs-dir)
  758.             (infos))
  759.         (tooltype
  760.             (dest (tackon aem-docs-dir "AEMAIL.doc"))
  761.             (setdefaulttool "more"))))       
  762.  
  763.     (if (BITAND aem-docs 4)
  764.         (copyfiles
  765.             (prompt "Copying AEMAIL.guide file to " aem-docs-dir)
  766.             (source (tackon source-dir "AEMAIL.guide"))
  767.             (dest   aem-docs-dir)
  768.             (infos)))
  769.  
  770.     (if (BITAND aem-docs 8)
  771.         ((copyfiles
  772.             (prompt "Copying email.txt file to " aem-docs-dir)
  773.             (source (tackon source-dir "email.txt"))
  774.             (dest   aem-docs-dir)
  775.             (infos))
  776.         (tooltype
  777.             (dest (tackon aem-docs-dir "email.txt"))
  778.             (setdefaulttool "more"))))       
  779.  
  780. ))
  781.  
  782. (tooltype
  783.     (prompt "Setting AEMail Tool Types")
  784.     (dest (tackon @default-dest "AEMail"))
  785.     (if (<> "" aem-config)
  786.         (settooltype "CONFIG" aem-config))
  787.     (if (= 1 aem-interlace)
  788.         (settooltype "INTERLACE" "YES"))
  789.     (if (<> "" aem-username)
  790.         (settooltype "USERID" aem-username))
  791.     (if (<> "" aem-password)
  792.         (settooltype "PASSWRD" aem-password))
  793.     (if (<> "" aem-realname)
  794.         (settooltype "REALNAME" aem-realname))
  795.     (if (<> "" aem-from)
  796.         (settooltype "FROM" aem-from))
  797.     (if (<> "" aem-replyto)
  798.         (settooltype "REPLYTO" aem-replyto))
  799.     (if (<> "" aem-organization)
  800.         (settooltype "ORGANIZATION" aem-organization))
  801.     (if (<> "" aem-domain)
  802.         (settooltype "DOMAIN" aem-domain))
  803.     (if (<> "" aem-popserver)
  804.         (settooltype "POP_SERVER" aem-popserver))
  805.     (if (<> "" aem-smtpserver)
  806.         (settooltype "SMTP_SERVER" aem-smtpserver))
  807.     (if (<> "" aem-editor)
  808.         (settooltype "EDITOR" ("\"%s\"" aem-editor)))
  809.     (if (<> "" aem-startnet)
  810.         (settooltype "STARTNET" aem-startnet))
  811.     (if (<> "" aem-stopnet)
  812.         (settooltype "STOPNET" aem-stopnet))
  813.     (if (BITAND aem-options 1)
  814.         (settooltype "DELETEMAIL" "YES"))
  815.     (if (BITAND aem-options 2)
  816.         (settooltype "STRIPDUPS" "YES"))
  817.     (if (BITAND aem-options 4)
  818.         (settooltype "FULLHEADER" "YES"))
  819.     (if (BITAND aem-options 8)
  820.         (settooltype "HDRINREPLY" "YES"))
  821.     (if (BITAND aem-options 16)
  822.         (settooltype "AUTOCONNECT" "YES"))
  823. )
  824.  
  825. (procedure aemp-build_mailcap
  826.  
  827.     ((set
  828.         aem-mimetypes
  829.             (askoptions
  830.                 (prompt "Indicate those mime types/subtypes you want "
  831.                         "display programs for")
  832.                 (help   "Check which types/subtypes that you will specify "
  833.                         "a display program for.  If you specify the type/all "
  834.                         "option you must have a program that can determine "
  835.                         "the appropriate display subtype")
  836.                 (choices    "images/all"
  837.                             "images/gif"
  838.                             "images/jpeg"
  839.                             "images/x-iff"
  840.                             "audio/all"
  841.                             "audio/basic"
  842.                             "video/all"
  843.                             "video/mpeg"))
  844.  
  845.         aem-curmailcap 0)
  846.  
  847.     (delete aem-mailcap_file)
  848.  
  849.     (while (<> 0 aem-mimetypes)
  850.         ((if (BITAND aem-mimetypes 1)
  851.             ((set
  852.                 aem-curmimet
  853.                     (select aem-curmailcap "images/*"
  854.                                            "images/gif"
  855.                                            "images/jpeg"
  856.                                            "images/x-iff"
  857.                                            "audio/*"
  858.                                            "audio/basic"
  859.                                            "video/*"
  860.                                            "video/mpeg")
  861.  
  862.                 aem-mimefile
  863.                     (askfile
  864.                         (prompt "Indicate program to display " aem-curmimet)
  865.                         (help   "Select the program in the file list that will "
  866.                                 "be used the display the file described by the "
  867.                                 "indicated mime type/subtype")
  868.                         (default ""))
  869.  
  870.                 aem-mimefile
  871.                     (askstring
  872.                         (prompt "Add the parameters required for the mime "
  873.                                 "display program you selected\n\n"
  874.                                 "You must always add '%s' to specify where "
  875.                                 "the file you are displaying goes.\n")
  876.                         (help   "You will need to add parmeters that may be "
  877.                                 "required by the display program that you "
  878.                                 "specified.  One required parameter required "
  879.                                 "by ALL programs is '%s' to specify where "
  880.                                 "the file name for the file you are "
  881.                                 "displaying goes.\n")
  882.                         (default (cat aem-mimefile " %s")))
  883.  
  884.                 aem-mimeonwb
  885.                     (askbool
  886.                         (prompt "Does the mime display program have to open "
  887.                                 "on the Workbench?"
  888.                         (help   "Some programs will always open on the "
  889.                                 "Workbench.  Others will open on their own "
  890.                                 "screen.  If your display program opens on "
  891.                                 "the Workbench, you must reply 'YES' to this "
  892.                                 "request.\n")))
  893.  
  894.                 aem-mimefile
  895.                     (if (= 1 aem-mimeonwb)
  896.                         (cat "WB;" aem-mimefile)
  897.                         ("%s" aem-mimefile)))
  898.  
  899.             (textfile
  900.                 (prompt "Creating .mailcap file")
  901.                 (help   "Creating .mailcap file")
  902.                 (dest   aem-mailcap_file)
  903.                 (include aem-mailcap_file)
  904.                 (append ("%s; \"%s\"\n" aem-curmimet aem-mimefile)))))
  905.         (set aem-curmailcap (+ 1 aem-curmailcap))
  906.         (set aem-mimetypes (shiftright aem-mimetypes 1))
  907.  
  908.     )))
  909. )
  910.  
  911. (set aem-existmailcap 0)
  912.  
  913. (if (= 2 @user-level)
  914.     (set aem-existmailcap
  915.         (askbool
  916.             (prompt "\nDo you want to use an existing mailcap file used by "
  917.                     "another program?\n\nIf you want to use the default "
  918.                     "mailcap file that comes with AEMail, reply 'NO' to this "
  919.                     "message.")
  920.             (help   "AEMAIL can run with a mailcap file created for another "
  921.                     "program.  If you reply 'YES' to this message you will "
  922.                     "be prompted for the directory containing your mailcap "
  923.                     "file and the MAILCAP= tool type will be set up in you "
  924.                     "AEMAIL icon"))))
  925.  
  926. (if (= 1 aem-existmailcap)
  927.     ((set aem-mailcapdir
  928.         (askdir
  929.             (prompt "Enter the drawer that contains your mailcap file")
  930.             (help   "AEMAIL can run with a mailcap file created for another "
  931.                     "program.  Enter the directory that contains the mailcap "
  932.                     "file that you want and the MAILCAP= tool type will be set "
  933.                     "up in you AEMAIL icon")
  934.             (default aem-mail-dir)
  935.             (newpath)))
  936.     (if (= 1 (exists (tackon aem-mailcapdir "mailcap")(noreq)))
  937.         (tooltype
  938.             (prompt "Setting AEMail Tool Types")
  939.             (dest (tackon @default-dest "AEMail"))
  940.             (settooltype "MAILCAP_DIR" aem-mailcapdir))
  941.         (message "A mailcap file does not exist in the directory you have "
  942.                  "specified. Continuing assuming no existing mailcap file."))))
  943.  
  944. (if (< exec-version version_3_0)
  945.     (if (= 2 @user-level)
  946.         ((set
  947.             aem-createmailcap
  948.             (askbool
  949.                 (prompt "\nYou are running under AmigaDos 2.1.  Do you want "
  950.                     "to create your own mailcap file?\n")
  951.                 (help   "AEMAIL is configured either by Tool Types in it's icon "
  952.                     "or by a configuration screen which is automatically "
  953.                     "called up when you first execute AEMAIL if the Tool "
  954.                     "Type parameters were not given.  By replying "
  955.                     "'Yes, Configure Now' you will be setting the Tool Type "
  956.                     "parameters\n"))
  957.             aem-mailcap_file (tackon aem-mail-dir "mailcap"))
  958.         (if (= 1 aem-createmailcap)
  959.             (aemp-build_mailcap))))
  960.     (copyfiles
  961.         (prompt "Copying mailcap to " aem-mail-dir)
  962.         (source (tackon source-dir "mailcap"))
  963.         (dest   aem-mail-dir))
  964. )
  965.  
  966. (textfile
  967.     (prompt "Creating ENV:AEMail_Dir")
  968.     (help "Creating ENV:AEMail_Dir")
  969.     (dest "ENV:AEMail_Dir")
  970.     (append @default-dest))
  971.  
  972. (textfile
  973.     (prompt "Creating ENVARC:AEMail_Dir")
  974.     (help "Creating ENVARC:AEMail_Dir")
  975.     (dest "ENVARC:AEMail_Dir")
  976.     (append @default-dest))
  977.  
  978.  
  979. (startup
  980.     aem-name
  981.         (prompt "Adding AEMAIL assign to S:User-Startup")
  982.         (help   "An ASSIGN statement for AEMAIL will now be added to the S:User-Startup")
  983.         (command ("ASSIGN %s \"%s\"\n" aem-assign aem-mail-dir))
  984.         (command ("ASSIGN C: sys:REXXC ADD")))
  985.  
  986. (makeassign aem-name aem-mail-dir)
  987.  
  988. (message
  989.     "\n\nThe installation of AEMAIL is now complete.  You can execute AEMail "
  990.     "now by double clicking on it's icon without rebooting your system."
  991.     "  The AEMAIL: assignment has been made and also has been placed in your "
  992.     "S:User-Startup file.  Please read the AEMail.Readme file before "
  993.     "executing AEMail.")
  994.  
  995. (run ("run %s RAM:AEMail.Readme" pager-cmd) (safe))
  996.  
  997. (exit)
  998.  
  999.